
$(function(){
	$.ajax({
		type:"POST",
		url:"/organization/getOrgTree",
		success:function(d){	
			layui.use('tree', function(){
			    var tree = layui.tree;
			    
			    //渲染
			    tree.render({
			        elem: '#test1', //默认是点击节点可进行收缩
			        showLine: false,  //是否开启连接线
			        onlyIconControl: true,
			        data: d.data,
			        click: function(obj){
			            //给父页面
			        	parent.$("#parentId").val(obj.data.id);
			           parent.$("#parentName").val(obj.data.label);
			          
			         }
			      });
			  });
			     
		}
	});
})


